package com.upb.webserver.common.properties;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;

@Data
@Component
public class RestProperties {

    @Value("${rest.httpTimeOut}")
    private Integer httpTimeOut = 30 * 000; // ms
    @Value("${rest.chainCodeInitTimeOut}")
    private Integer chainCodeInitTimeOut = 180 * 000; // ms
    @Value("${rest.sleepTimeAfterServerConnectFail}")
    private Long sleepTimeAfterServerConnectFail = 60 * 5L; // s

    @Value("#{'${rest.webase.stat}'.split(',')}")
    private List<String> webaseStatAddressList;

    @Value("#{'${rest.webase.chain-manager}'.split(',')}")
    private List<String> webaseChainManagerAddressList;

    @Value("#{'${rest.webase.data-fetcher}'.split(',')}")
    private List<String> webaseDataFetcherAddressList;

    @Value("#{'${rest.hyperledger.stat}'.split(',')}")
    private List<String> hyperledgerStatAddressList;

    @Value("#{'${rest.hyperledger.chain-manager}'.split(',')}")
    private List<String> hyperledgerChainManagerAddressList;

    @Value("#{'${rest.hyperledger.data-fetcher}'.split(',')}")
    private List<String> hyperledgerDataFetcherAddressList;
}


